/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package InternetHax;
import java.util.Vector;
/**
 *
 * @author LoginError
 */
public class Stack {
    Vector stack = new Vector();

    synchronized public boolean isEmpty()
    {
        return stack.isEmpty();
    }

    synchronized public int size()
    {
        return stack.size();
    }

    synchronized public void push(Object o)
    {
        stack.insertElementAt(o, stack.size()-1);
    }

    synchronized public Object peek()
    {
        return stack.lastElement();
    }

    synchronized public Object pop()
    {
        if(!stack.isEmpty())
        {
            Object popObject = stack.lastElement();
            stack.removeElementAt(stack.size() -1);
            return popObject;
        }
        else
           return null;
    }

    synchronized public Vector getElements()
    {
        return stack;
    }
}
